<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>理货</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="./images/favicon.png" />

    <!-- <link href="./css/style.css" rel="stylesheet" /> -->

    <!-- Styles -->
    <link href="assets/css/lib/rangSlider/ion.rangeSlider.css" rel="stylesheet">
    <!--Themes Jquery Bar Rating-->
    <link href="assets/css/lib/rangSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">

    <link href="assets/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="assets/css/lib/themify-icons.css" rel="stylesheet">
    <link href="assets/css/lib/jsgrid/jsgrid-theme.min.css" rel="stylesheet" />
    <link href="assets/css/lib/jsgrid/jsgrid.min.css" type="text/css" rel="stylesheet" />
    <link href="assets/css/lib/menubar/sidebar.css" rel="stylesheet">
    <link href="assets/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/lib/helper.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">

    <!-- jquery vendor -->
    <script src="assets/js/lib/jquery.min.js"></script>
    <script src="assets/js/lib/jquery.nanoscroller.min.js"></script>

</head>

<body>

    <script src="./common.js"></script>

    <div class="content-wrap">
        <div class="main">
            <div class="container-fluid">
                <div id="main-content">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card">
                                <div class="card-body">
                                    <h4 class="card-title m-b-40">功能选择</h4>
                                    <ul class="nav nav-tabs" id="myTab" role="tablist">
                                        <li class="nav-item">
                                            <a class="nav-link active" id="unwareManage-tab" data-toggle="tab"
                                                href="#unwareManage" role="tab" aria-controls="unwareManage"
                                                aria-expanded="true">
                                                <span class="hidden-sm-up"><i class="ti-home"></i></span>
                                                <span class="hidden-xs-down">未入库商品管理</span>
                                            </a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link" id="wareManage-tab" data-toggle="tab" href="#wareManage"
                                                role="tab" aria-controls="wareManage" aria-expanded="true">
                                                <span class="hidden-sm-up"><i class="ti-home"></i></span>
                                                <span class="hidden-xs-down">库内商品管理</span>
                                            </a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link" id="wareToShop-tab" data-toggle="tab" href="#wareToShop"
                                                role="tab" aria-controls="wareToShop" aria-expanded="true">
                                                <span class="hidden-sm-up"><i class="ti-home"></i></span>
                                                <span class="hidden-xs-down">商品上架</span>
                                            </a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link" id="shopManage-tab" data-toggle="tab" href="#shopManage"
                                                role="tab" aria-controls="shopManage" aria-expanded="true">
                                                <span class="hidden-sm-up"><i class="ti-home"></i></span>
                                                <span class="hidden-xs-down">店内商品管理</span>
                                            </a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link" id="shopToWare-tab" data-toggle="tab" href="#shopToWare"
                                                role="tab" aria-controls="shopToWare" aria-expanded="true">
                                                <span class="hidden-sm-up"><i class="ti-home"></i></span>
                                                <span class="hidden-xs-down">商品下架</span>
                                            </a>
                                        </li>
                                        <!-- <li class="nav-item"> <a class="nav-link" id="profile-tab" data-toggle="tab"
                                                href="#profile5" role="tab" aria-controls="profile"><span
                                                    class="hidden-sm-up"><i class="ti-user"></i></span> <span
                                                    class="hidden-xs-down">Profile</span></a></li>
                                        <li class="nav-item dropdown">
                                            <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#"
                                                role="button" aria-haspopup="true" aria-expanded="false">
                                                <span class="hidden-sm-up"><i class="ti-email"></i></span> <span
                                                    class="hidden-xs-down">Dropdown</span>
                                            </a>
                                            <div class="dropdown-menu"> <a class="dropdown-item" id="dropdown1-tab"
                                                    href="#dropdown1" role="tab" data-toggle="tab"
                                                    aria-controls="dropdown1">@fat</a> <a class="dropdown-item"
                                                    id="dropdown2-tab" href="#dropdown2" role="tab" data-toggle="tab"
                                                    aria-controls="dropdown2">@mdo</a> </div>
                                        </li> -->
                                    </ul>
                                    <div class="tab-content tabcontent-border p-20" id="myTabContent">
                                        <div class="tab-pane fade show active" id="unwareManage" role="tabpanel"
                                            aria-labelledby="unwareManage-tab">
                                            <div class="row">
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">未入库列表</h4>
                                                            <div class="jsgrid-table-panel">
                                                                <div id="unwareJsGrid"></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">入库</h4>
                                                            <h6>目前选中的条目</h5>
                                                                <div class="basic-form">
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品条码</label>
                                                                                <input id="unware_barCode" type="text"
                                                                                    class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>批次号</label>
                                                                                <input id="unware_batchNo" type="text"
                                                                                    class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品名称</label>
                                                                                <input id="unware_productName"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>保质期剩余</label>
                                                                                <input id="unware_timeRemain"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-8">
                                                                            <div class="form-group">
                                                                                <label>数量</label>
                                                                                <!-- <input id="amountNow" type="text"
                                                                                    class="form-control"
                                                                                    readonly="readonly"> -->
                                                                                <input id="unware_amountNow" type="text"
                                                                                    name="example_name" value=""
                                                                                    readonly="readonly" />

                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <hr />
                                                                    <div class="row">
                                                                        <div class="col-lg-3">
                                                                            <h6>选择一个货架</h5>
                                                                        </div>
                                                                    </div>
                                                                    <div class="basic-form">
                                                                        <div class="row">
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>仓库</label>
                                                                                    <select id="unware_warehouseSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control warehouseSelect">
                                                                                        <option value="nullSelect">
                                                                                            选择一个仓库</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>分区</label>
                                                                                    <select id="unware_sectionSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个分区</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>货架</label>
                                                                                    <select id="unware_shelfSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个货架</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <button type="button"
                                                                            class="btn btn-primary m-b-10 m-l-5"
                                                                            id="locateCommoditySubmit">提交</button>
                                                                    </div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade show " id="wareManage" role="tabpanel"
                                            aria-labelledby="wareManage-tab">
                                            <div class="row">
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">商品列表</h4>
                                                            <h6>选择一个货架</h5>
                                                                <div class="row">
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>仓库</label>
                                                                            <select
                                                                                id="wareManageSource_warehouseSelect"
                                                                                type="dropdown"
                                                                                class="form-control warehouseSelect">
                                                                                <option value="nullSelect">
                                                                                    选择一个仓库</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>分区</label>
                                                                            <select id="wareManageSource_sectionSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个分区</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>货架</label>
                                                                            <select id="wareManageSource_shelfSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个货架</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="jsgrid-table-panel">
                                                                    <div id="warehouseCommodityJsGrid"></div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">移动</h4>
                                                            <h6>目前选中的条目</h5>
                                                                <div class="basic-form">
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品条码</label>
                                                                                <input id="wareManage_barCode"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>批次号</label>
                                                                                <input id="wareManage_batchNo"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品名称</label>
                                                                                <input id="wareManage_productName"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>保质期剩余</label>
                                                                                <input id="wareManage_timeRemain"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-8">
                                                                            <div class="form-group">
                                                                                <label>数量</label>
                                                                                <input id="wareManage_amountNow"
                                                                                    type="text" name="example_name"
                                                                                    value="" readonly="readonly" />
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <hr />
                                                                    <div class="row">
                                                                        <div class="col-lg-3">
                                                                            <h6>选择一个货架</h5>
                                                                        </div>
                                                                    </div>
                                                                    <div class="basic-form">
                                                                        <div class="row">
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>仓库</label>
                                                                                    <select
                                                                                        id="wareManageTarget_warehouseSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control warehouseSelect">
                                                                                        <option value="nullSelect">
                                                                                            选择一个仓库</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>分区</label>
                                                                                    <select
                                                                                        id="wareManageTarget_sectionSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个分区</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>货架</label>
                                                                                    <select
                                                                                        id="wareManageTarget_shelfSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个货架</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <button type="button"
                                                                            class="btn btn-primary m-b-10 m-l-5"
                                                                            id="wareManage_locateCommoditySubmit">提交</button>
                                                                    </div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade show " id="wareToShop" role="tabpanel"
                                            aria-labelledby="wareToShop-tab">
                                            <div class="row">
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">商品列表</h4>
                                                            <h6>选择一个货架</h5>
                                                                <div class="row">
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>仓库</label>
                                                                            <select
                                                                                id="wareToShopSource_warehouseSelect"
                                                                                type="dropdown"
                                                                                class="form-control warehouseSelect">
                                                                                <option value="nullSelect">
                                                                                    选择一个仓库</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>分区</label>
                                                                            <select id="wareToShopSource_sectionSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个分区</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>货架</label>
                                                                            <select id="wareToShopSource_shelfSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个货架</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="jsgrid-table-panel">
                                                                    <div id="shopCommodityJsGrid"></div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">移动</h4>
                                                            <h6>目前选中的条目</h5>
                                                                <div class="basic-form">
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品条码</label>
                                                                                <input id="wareToShop_barCode"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>批次号</label>
                                                                                <input id="wareToShop_batchNo"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品名称</label>
                                                                                <input id="wareToShop_productName"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>保质期剩余</label>
                                                                                <input id="wareToShop_timeRemain"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-8">
                                                                            <div class="form-group">
                                                                                <label>数量</label>
                                                                                <input id="wareToShop_amountNow"
                                                                                    type="text" name="example_name"
                                                                                    value="" readonly="readonly" />
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <hr />
                                                                    <div class="row">
                                                                        <div class="col-lg-3">
                                                                            <h6>选择一个货架</h5>
                                                                        </div>
                                                                    </div>
                                                                    <div class="basic-form">
                                                                        <div class="row">
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>商店</label>
                                                                                    <select
                                                                                        id="wareToShopTarget_shopSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control shopSelect">
                                                                                        <option value="nullSelect">
                                                                                            选择一个商店</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>分区</label>
                                                                                    <select
                                                                                        id="wareToShopTarget_shopSectionSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个分区</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>货架</label>
                                                                                    <select
                                                                                        id="wareToShopTarget_shopShelfSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个货架</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <button type="button"
                                                                            class="btn btn-primary m-b-10 m-l-5"
                                                                            id="wareToShop_locateCommoditySubmit">提交</button>
                                                                    </div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade show " id="shopManage" role="tabpanel"
                                            aria-labelledby="shopManage-tab">
                                            <div class="row">
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">商品列表</h4>
                                                            <h6>选择一个货架</h5>
                                                                <div class="row">
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>商店</label>
                                                                            <select id="shopManageSource_shopSelect"
                                                                                type="dropdown"
                                                                                class="form-control shopSelect">
                                                                                <option value="nullSelect">
                                                                                    选择一个商店</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>分区</label>
                                                                            <select
                                                                                id="shopManageSource_shopSectionSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个分区</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-4">
                                                                        <div class="form-group">
                                                                            <label>货架</label>
                                                                            <select
                                                                                id="shopManageSource_shopShelfSelect"
                                                                                type="dropdown" class="form-control"
                                                                                disabled=true>
                                                                                <option value="nullSelect">
                                                                                    选择一个货架</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="jsgrid-table-panel">
                                                                    <div id="shopManageCommodityJsGrid"></div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="card">
                                                        <div class="card-body">
                                                            <h4 class="card-title m-b-40">移动</h4>
                                                            <h6>目前选中的条目</h5>
                                                                <div class="basic-form">
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品条码</label>
                                                                                <input id="shopManage_barCode"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>批次号</label>
                                                                                <input id="shopManage_batchNo"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>商品名称</label>
                                                                                <input id="shopManage_productName"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-lg-4">
                                                                            <div class="form-group">
                                                                                <label>保质期剩余</label>
                                                                                <input id="shopManage_timeRemain"
                                                                                    type="text" class="form-control"
                                                                                    readonly="readonly">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-lg-8">
                                                                            <div class="form-group">
                                                                                <label>数量</label>
                                                                                <input id="shopManage_amountNow"
                                                                                    type="text" name="example_name"
                                                                                    value="" readonly="readonly" />
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <hr />
                                                                    <div class="row">
                                                                        <div class="col-lg-3">
                                                                            <h6>选择一个货架</h5>
                                                                        </div>
                                                                    </div>
                                                                    <div class="basic-form">
                                                                        <div class="row">
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>商店</label>
                                                                                    <select
                                                                                        id="shopManageTarget_shopSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control shopSelect">
                                                                                        <option value="nullSelect">
                                                                                            选择一个商店</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>分区</label>
                                                                                    <select
                                                                                        id="shopManageTarget_shopSectionSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个分区</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                            <div class="col-lg-4">
                                                                                <div class="form-group">
                                                                                    <label>货架</label>
                                                                                    <select
                                                                                        id="shopManageTarget_shelfSelect"
                                                                                        type="dropdown"
                                                                                        class="form-control"
                                                                                        disabled=true>
                                                                                        <option value="nullSelect">
                                                                                            选择一个货架</option>
                                                                                    </select>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <button type="button"
                                                                            class="btn btn-primary m-b-10 m-l-5"
                                                                            id="shopManage_locateCommoditySubmit">提交</button>
                                                                    </div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade show " id="shopToWare" role="tabpanel"
                                            aria-labelledby="shopToWare-tab">
                                            <p>
                                                shopToWare
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="footer">
                            <div class="copyright">
                                <p>Copyright © Designed &amp; Developed by <a href="#" target="_blank">Quixkit</a> 2019
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- nano scroller -->
    <script src="assets/js/lib/menubar/sidebar.js"></script>
    <script src="assets/js/lib/preloader/pace.min.js"></script>
    <!-- sidebar -->

    <script src="assets/js/lib/rangeSlider/ion.rangeSlider.min.js"></script><!-- scripit init-->
    <script src="assets/js/lib/rangeSlider/moment.js"></script><!-- scripit init-->
    <script src="assets/js/lib/rangeSlider/moment-with-locales.js"></script><!-- scripit init-->

    <script>
        $(document).ready(function () {
            $("#unware_amountNow").ionRangeSlider({
                min: 0,
                max: 0
            });
            window.unware_amountNowBar = $("#unware_amountNow").data("ionRangeSlider");
        });
    </script>

    <!-- JS Grid Scripts Start-->

    <script>
        $(document).ready(function () {
            var unwaredb = {
                loadData: function (filter) {
                    return window.unwaredb.clients;
                },
                insertItem: function (insertingClient) {
                    this.clents.push(insertingClient);
                },
                updateItem: function (updatingClient) { },
                deleteItem: function (deletingClient) {
                    var clientIndex = $.inArray(deletingClient, this.clents);
                    this.clents.splice(clientIndex, 1);
                }
            };
            window.unwaredb = unwaredb;
            unwaredb.clents = [
            ];
        });
    </script>

    <!-- <script src="assets/js/lib/jsgrid/db.js"></script> -->
    <script src="assets/js/lib/jsgrid/jsgrid.core.js"></script>
    <script src="assets/js/lib/jsgrid/jsgrid.load-indicator.js"></script>
    <script src="assets/js/lib/jsgrid/jsgrid.load-strategies.js"></script>
    <script src="assets/js/lib/jsgrid/jsgrid.sort-strategies.js"></script>
    <script src="assets/js/lib/jsgrid/jsgrid.field.js"></script>
    <script src="assets/js/lib/jsgrid/fields/jsgrid.field.text.js"></script>
    <script src="assets/js/lib/jsgrid/fields/jsgrid.field.number.js"></script>
    <script src="assets/js/lib/jsgrid/fields/jsgrid.field.select.js"></script>
    <script src="assets/js/lib/jsgrid/fields/jsgrid.field.checkbox.js"></script>
    <script src="assets/js/lib/jsgrid/fields/jsgrid.field.control.js"></script>
    <script>
        $(function () {
            $("#unwareJsGrid").jsGrid({
                height: "100%",
                width: "100%",
                filtering: false,
                editing: false,
                inserting: false,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 4,
                deleteConfirm: "Do you really want to delete the client?",
                controller: unwaredb,
                noDataContent: "目前是空的......",
                fields: [
                    { name: "barCode", title: "商品条码", type: "text", width: 80 },
                    { name: "batchNo", title: "批次号", type: "text", width: 90 },
                    { name: "productName", title: "商品名称", type: "text", width: 100 },
                    { name: "timeRemain", title: "保质期剩余", type: "text", width: 60 },
                    { name: "amountNow", title: "数量", type: "number", width: 30 }
                ],
                rowClick: function (selectRow) {
                    var selectRowData = selectRow.item;
                    $.each(selectRowData, function (k, v) {
                        if ("amountNow" != k)
                            $("#unware_" + k).val(v);
                        else {
                            window.unware_amountNowBar.update({
                                min: 1,
                                max: v,
                                from: v
                            });
                        }
                    })
                }
            });
        });
    </script>

    <script>
        //页面初始化时加载未入库数据
        $(document).ready(function () {
            var requestObj = {};
            requestObj["requestService"] = "LocateCommodityService";
            requestObj["requestMethod"] = "queryUnlocateCommodity";
            requestObj["data"] = {};
            var requestJson = JSON.stringify(requestObj)
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                async: false,
                contentType: "application/json",
                data: requestJson,
                success: function (msg) {
                    window.unwaredb.clients = msg.data;
                    $("#unwareJsGrid").jsGrid("loadData");
                }
            });
        })
    </script>

    <script>
        //封装获取仓库信息请求
        function selectAllWarehouse() {
            var requestObj = {};
            requestObj["requestService"] = "WarehouseShelfManageService";
            requestObj["requestMethod"] = "selectAllWarehouse";
            requestObj["data"] = {};
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                async: false,
                contentType: "application/json",
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //页面初始化时加载仓库数据
        $(document).ready(function () {
            var msg = selectAllWarehouse();
            window.warhouseData = msg.data;
            $.each(window.warhouseData, function (k, v) {
                $(".warehouseSelect").append("<option value =\"" + v.warehouseNo + "\">" + v.warehouseName + "</option>")
            })
        })
    </script>

    <script>
        //封装获取仓库分区信息方法
        function selectAllWarehouseSection(selectWarehouseNo) {
            var requestObj = {};
            requestObj["requestService"] = "WarehouseShelfManageService";
            requestObj["requestMethod"] = "selectAllWarehouseSection";
            var data = {};
            data.warehouseNo = selectWarehouseNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                contentType: "application/json",
                async: false,
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //封装获取分区货架信息方法
        function selectAllWarehouseShelf(selectSectionNo) {
            var requestObj = {};
            requestObj["requestService"] = "WarehouseShelfManageService";
            requestObj["requestMethod"] = "selectAllWarehouseShelf";
            var data = {};
            data.warehouseSectionNo = selectSectionNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                contentType: "application/json",
                async: false,
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //重设指定组的分区选项
        function resetWarehouseSelect(groupName) {
            $("#" + groupName + "_sectionSelect option").remove();
            $("#" + groupName + "_sectionSelect").append("<option value=\"nullSelect\">选择一个分区</option>");
            $("#" + groupName + "_sectionSelect").attr("disabled", true);
            $("#" + groupName + "_shelfSelect option").remove();
            $("#" + groupName + "_shelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $("#" + groupName + "_shelfSelect").attr("disabled", true);
        }
        //重设指定组的货架选项
        function resetSectionSelect(groupName) {
            $("#" + groupName + "_shelfSelect option").remove();
            $("#" + groupName + "_shelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $("#" + groupName + "_shelfSelect").attr("disabled", true);
        }
    </script>


    <script>
        function setSectionData(groupName, data) {
            $("#" + groupName + "_sectionSelect option").remove();
            $("#" + groupName + "_sectionSelect").append("<option value=\"nullSelect\">选择一个分区</option>");
            $.each(data, function (k, v) {
                $("#" + groupName + "_sectionSelect").append("<option value =\"" + v.warehouseSectionNo + "\">" + v.warehouseSectionName + "</option>");
                $("#" + groupName + "_sectionSelect").attr("disabled", false);
            })
        }
        function setShelfData(groupName, data) {
            $("#" + groupName + "_shelfSelect option").remove();
            $("#" + groupName + "_shelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $.each(data, function (k, v) {
                $("#" + groupName + "_shelfSelect").append("<option value =\"" + v.warehouseShelfNo + "\">" + v.warehouseShelfName + "</option>");
                $("#" + groupName + "_shelfSelect").attr("disabled", false);
            })
        }
    </script>

    <script>
        //未入库商品管理-选择仓库后加载分区号
        $(document).ready(function () {
            $("#unware_warehouseSelect").change(function () {
                var selectWarehouseNo = $("#unware_warehouseSelect").val();
                resetWarehouseSelect("unware");
                if (selectWarehouseNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseSection(selectWarehouseNo);
                setSectionData("unware", msg.data);
            })
        })
    </script>

    <script>
        //未入库商品管理-选择分区后加载货架号
        $(document).ready(function () {
            $("#unware_sectionSelect").change(function () {
                var selectSectionNo = $("#unware_sectionSelect").val();
                resetSectionSelect("unware");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseShelf(selectSectionNo);
                setShelfData("unware", msg.data);
            })
        })
    </script>

    <script>
        //未入库商品管理-点击提交按钮
        $(document).ready(function () {
            $("#locateCommoditySubmit").click(function () {
                var requestObj = {};
                requestObj["requestService"] = "LocateCommodityService";
                requestObj["requestMethod"] = "locateCommodity";
                var data = {};
                data.barCode = $("#unware_barCode").val();
                data.batchNo = $("#unware_batchNo").val();
                data.amountNow = window.unware_amountNowBar.old_from;
                data.warehouseShelfNo = $("#unware_shelfSelect").val();
                $.each(data, function (k, v) {
                    if (v == null || v.length == 0) {
                        alert("存在未填写的数据");
                        return;
                    }
                })
                requestObj["data"] = data;
                var requestJson = JSON.stringify(requestObj)
                $.ajax({
                    type: "POST",
                    url: "http://192.168.70.135:80/api/",
                    contentType: "application/json",
                    data: requestJson,
                    success: function (msg) {
                        alert("成功执行请求");
                        location.reload();
                    },
                    error: function (msg) {
                        alert("发生错误: " + msg.responseJSON.data[0].errorMessage);
                    }
                });
            })
        })
    </script>

    <!-- JS Grid Scripts End-->

    <!-- 库内商品管理js -->

    <script>
        $(document).ready(function () {
            $("#wareManage_amountNow").ionRangeSlider({
                min: 0,
                max: 0
            });
            window.wareManage_amountNowBar = $("#wareManage_amountNow").data("ionRangeSlider");
        });
    </script>

    <script>
        $(document).ready(function () {
            var warehouseCommoditydb = {
                loadData: function (filter) {
                    return window.warehouseCommoditydb.clients;
                },
                insertItem: function (insertingClient) {
                    this.clents.push(insertingClient);
                },
                updateItem: function (updatingClient) { },
                deleteItem: function (deletingClient) {
                    var clientIndex = $.inArray(deletingClient, this.clents);
                    this.clents.splice(clientIndex, 1);
                }
            };
            window.warehouseCommoditydb = warehouseCommoditydb;
            warehouseCommoditydb.clents = [
            ];
        });
    </script>

    <script>
        $(function () {
            $("#warehouseCommodityJsGrid").jsGrid({
                height: "100%",
                width: "100%",
                filtering: false,
                editing: false,
                inserting: false,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 4,
                deleteConfirm: "Do you really want to delete the client?",
                controller: warehouseCommoditydb,
                noDataContent: "目前是空的......",
                fields: [
                    { name: "barCode", title: "商品条码", type: "text", width: 80 },
                    { name: "batchNo", title: "批次号", type: "text", width: 90 },
                    { name: "productName", title: "商品名称", type: "text", width: 100 },
                    { name: "timeRemain", title: "保质期剩余", type: "text", width: 60 },
                    { name: "amount", title: "数量", type: "number", width: 30 }
                ],
                rowClick: function (selectRow) {
                    var selectRowData = selectRow.item;
                    $.each(selectRowData, function (k, v) {
                        if ("amount" != k)
                            $("#wareManage_" + k).val(v);
                        else {
                            window.wareManage_amountNowBar.update({
                                min: 1,
                                max: v,
                                from: v
                            });
                        }
                    })
                }
            });
        });
    </script>

    <script>
        //库内商品管理-原货架-选择仓库后加载分区号
        $(document).ready(function () {
            $("#wareManageSource_warehouseSelect").change(function () {
                var selectWarehouseNo = $("#wareManageSource_warehouseSelect").val();
                resetWarehouseSelect("wareManageSource");
                if (selectWarehouseNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseSection(selectWarehouseNo);
                setSectionData("wareManageSource", msg.data);
            })
        })
    </script>

    <script>
        //库内商品管理-原货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#wareManageSource_sectionSelect").change(function () {
                var selectSectionNo = $("#wareManageSource_sectionSelect").val();
                resetSectionSelect("wareManageSource");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseShelf(selectSectionNo);
                setShelfData("wareManageSource", msg.data);
            })
        })
    </script>

    <script>
        //封装查询指定货架商品请求
        function getWarehouseCommodityJsGridData(warehouseShelfNo) {
            var requestObj = {};
            requestObj["requestService"] = "QueryCommodityByLocationService";
            requestObj["requestMethod"] = "queryCommodityByWarehouseShelfNo";
            var data = {};
            data.warehouseShelfNo = warehouseShelfNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj)

            var returnResult;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                async: false,
                contentType: "application/json",
                data: requestJson,
                success: function (msg) {
                    $.each(msg.data, function (k, v) {
                        var productTime = v.productTime;
                        var expire = v.expire;
                        if (expire == null || expire.length == 0) {
                            v.timeRemain = "不存在";
                            return;
                        }
                        var timeRemain = Number(productTime) + Number(expire) * 86400000 - (new Date()).valueOf();
                        var timeRemain = parseInt(timeRemain / 86400000);
                        v.timeRemain = timeRemain;
                    });
                    returnResult = msg.data;
                }
            });
            return returnResult;
        }
    </script>

    <script>
        //库内商品管理-原货架-选择货架后加载商品列表
        $(document).ready(function () {
            $("#wareManageSource_shelfSelect").change(function () {
                var selectShelfNo = $("#wareManageSource_shelfSelect").val();
                if (selectShelfNo == "nullSelect") {
                    return;
                }
                window.warehouseCommoditydb.clients = getWarehouseCommodityJsGridData(selectShelfNo);
                $("#warehouseCommodityJsGrid").jsGrid("loadData");
            })
        })
    </script>

    <script>
        //库内商品管理-目标货架-选择仓库后加载分区号
        $(document).ready(function () {
            $("#wareManageTarget_warehouseSelect").change(function () {
                var selectWarehouseNo = $("#wareManageTarget_warehouseSelect").val();
                resetWarehouseSelect("wareManageTarget");
                if (selectWarehouseNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseSection(selectWarehouseNo);
                setSectionData("wareManageTarget", msg.data);
            })
        })
    </script>

    <script>
        //库内商品管理-目标货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#wareManageTarget_sectionSelect").change(function () {
                var selectSectionNo = $("#wareManageTarget_sectionSelect").val();
                resetSectionSelect("wareManageTarget");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseShelf(selectSectionNo);
                setShelfData("wareManageTarget", msg.data);
            })
        })
    </script>

    <script>
        //库内商品管理-点击提交按钮
        $(document).ready(function () {
            $("#wareManage_locateCommoditySubmit").click(function () {
                var requestObj = {};
                requestObj["requestService"] = "LocateCommodityService";
                requestObj["requestMethod"] = "moveCommodityInWarehouse";
                var data = {};
                data.barCode = $("#wareManage_barCode").val();
                data.batchNo = $("#wareManage_batchNo").val();
                data.sourceWarehouseShelfNo = $("#wareManageSource_shelfSelect").val();
                data.moveAmount = window.wareManage_amountNowBar.old_from;
                data.destinationWarehouseShelfNo = $("#wareManageTarget_shelfSelect").val();

                var validation = true;
                $.each(data, function (k, v) {
                    if (!validation)
                        return;
                    if (v == null || v.length == 0) {
                        alert("存在未填写的数据: " + k);
                        validation = false;
                        return;
                    }
                })
                if (!validation)
                    return;

                requestObj["data"] = data;
                var requestJson = JSON.stringify(requestObj)
                $.ajax({
                    type: "POST",
                    url: "http://192.168.70.135:80/api/",
                    contentType: "application/json",
                    data: requestJson,
                    success: function (msg) {
                        alert("成功执行请求");
                        location.reload();
                    },
                    error: function (msg) {
                        alert("发生错误: " + msg.responseJSON.data[0].errorMessage);
                    }
                });
            })
        })
    </script>

    <!-- 上架js -->
    <script>
        //封装获取商店信息请求
        function selectAllShop() {
            var requestObj = {};
            requestObj["requestService"] = "ShopShelfManageService";
            requestObj["requestMethod"] = "selectAllShop";
            requestObj["data"] = {};
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                async: false,
                contentType: "application/json",
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //页面初始化时加载商店数据
        $(document).ready(function () {
            var msg = selectAllShop();
            window.warhouseData = msg.data;
            $.each(window.warhouseData, function (k, v) {
                $(".shopSelect").append("<option value =\"" + v.shopNo + "\">" + v.shopName + "</option>")
            })
        })
    </script>

    <script>
        //封装获取商店分区信息方法
        function selectAllShopSection(selectShopNo) {
            var requestObj = {};
            requestObj["requestService"] = "ShopShelfManageService";
            requestObj["requestMethod"] = "selectAllShopSection";
            var data = {};
            data.shopNo = selectShopNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                contentType: "application/json",
                async: false,
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //封装获取商店分区货架信息方法
        function selectAllShopShelf(selectSectionNo) {
            var requestObj = {};
            requestObj["requestService"] = "ShopShelfManageService";
            requestObj["requestMethod"] = "selectAllShopShelf";
            var data = {};
            data.shopSectionNo = selectSectionNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj);
            var msg;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                contentType: "application/json",
                async: false,
                data: requestJson,
                success: function (response) {
                    msg = response;
                }
            });
            return msg;
        }
    </script>

    <script>
        //重设指定组的商店分区选项
        function resetShopSelect(groupName) {
            $("#" + groupName + "_shopSectionSelect option").remove();
            $("#" + groupName + "_shopSectionSelect").append("<option value=\"nullSelect\">选择一个分区</option>");
            $("#" + groupName + "_shopSectionSelect").attr("disabled", true);
            $("#" + groupName + "_shopShelfSelect option").remove();
            $("#" + groupName + "_shopShelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $("#" + groupName + "_shopShelfSelect").attr("disabled", true);
        }
        //重设指定组的商店货架选项
        function resetShopSectionSelect(groupName) {
            $("#" + groupName + "_shopShelfSelect option").remove();
            $("#" + groupName + "_shopShelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $("#" + groupName + "_shopShelfSelect").attr("disabled", true);
        }
    </script>


    <script>
        function setShopSectionData(groupName, data) {
            $("#" + groupName + "_shopSectionSelect option").remove();
            $("#" + groupName + "_shopSectionSelect").append("<option value=\"nullSelect\">选择一个分区</option>");
            $.each(data, function (k, v) {
                $("#" + groupName + "_shopSectionSelect").append("<option value =\"" + v.shopSectionNo + "\">" + v.shopSectionName + "</option>");
                $("#" + groupName + "_shopSectionSelect").attr("disabled", false);
            })
        }
        function setShopShelfData(groupName, data) {
            $("#" + groupName + "_shopShelfSelect option").remove();
            $("#" + groupName + "_shopShelfSelect").append("<option value=\"nullSelect\">选择一个货架</option>");
            $.each(data, function (k, v) {
                $("#" + groupName + "_shopShelfSelect").append("<option value =\"" + v.shopShelfNo + "\">" + v.shopShelfName + "</option>");
                $("#" + groupName + "_shopShelfSelect").attr("disabled", false);
            })
        }
    </script>

    <script>
        //上架-原货架-选择仓库后加载分区号
        $(document).ready(function () {
            $("#wareToShopSource_warehouseSelect").change(function () {
                var selectWarehouseNo = $("#wareToShopSource_warehouseSelect").val();
                resetWarehouseSelect("wareToShopSource");
                if (selectWarehouseNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseSection(selectWarehouseNo);
                setSectionData("wareToShopSource", msg.data);
            })
        })
    </script>

    <script>
        //上架-原货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#wareToShopSource_sectionSelect").change(function () {
                var selectSectionNo = $("#wareToShopSource_sectionSelect").val();
                resetSectionSelect("wareToShopSource");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllWarehouseShelf(selectSectionNo);
                setShelfData("wareToShopSource", msg.data);
            })
        })
    </script>

    <script>
        //上架-原货架-选择货架后加载商品列表
        $(document).ready(function () {
            $("#wareToShopSource_shelfSelect").change(function () {
                var selectShelfNo = $("#wareToShopSource_shelfSelect").val();
                if (selectShelfNo == "nullSelect") {
                    return;
                }
                window.shopCommoditydb.clients = getWarehouseCommodityJsGridData(selectShelfNo);
                $("#shopCommodityJsGrid").jsGrid("loadData");
            })
        })
    </script>

    <script>
        //上架-目标货架-选择商店后加载分区号
        $(document).ready(function () {
            $("#wareToShopTarget_shopSelect").change(function () {
                var selectShopNo = $("#wareToShopTarget_shopSelect").val();
                resetShopSelect("wareToShopTarget");
                if (selectShopNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopSection(selectShopNo);
                setShopSectionData("wareToShopTarget", msg.data);
            })
        })
    </script>

    <script>
        //上架-目标货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#wareToShopTarget_shopSectionSelect").change(function () {
                var selectSectionNo = $("#wareToShopTarget_shopSectionSelect").val();
                resetSectionSelect("wareToShopTarget");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopShelf(selectSectionNo);
                setShopShelfData("wareToShopTarget", msg.data);
            })
        })
    </script>

    <script>
        //上架-点击提交按钮
        $(document).ready(function () {
            $("#wareToShop_locateCommoditySubmit").click(function () {
                var requestObj = {};
                requestObj["requestService"] = "LocateCommodityService";
                requestObj["requestMethod"] = "moveCommodityToShop";
                var data = {};
                data.barCode = $("#wareToShop_barCode").val();
                data.batchNo = $("#wareToShop_batchNo").val();
                data.sourceWarehouseShelfNo = $("#wareToShopSource_shelfSelect").val();
                data.moveAmount = window.wareToShop_amountNowBar.old_from;
                data.destinationShopShelfNo = $("#wareToShopTarget_shopShelfSelect").val();

                var validation = true;
                $.each(data, function (k, v) {
                    if (!validation)
                        return;
                    if (v == null || v.length == 0) {
                        alert("存在未填写的数据: " + k);
                        validation = false;
                        return;
                    }
                })
                if (!validation)
                    return;

                requestObj["data"] = data;
                var requestJson = JSON.stringify(requestObj)
                $.ajax({
                    type: "POST",
                    url: "http://192.168.70.135:80/api/",
                    contentType: "application/json",
                    data: requestJson,
                    success: function (msg) {
                        alert("成功执行请求");
                        location.reload();
                    },
                    error: function (msg) {
                        alert("发生错误: " + msg.responseJSON.data[0].errorMessage);
                    }
                });
            })
        })
    </script>

    <script>
        $(document).ready(function () {
            $("#wareToShop_amountNow").ionRangeSlider({
                min: 0,
                max: 0
            });
            window.wareToShop_amountNowBar = $("#wareToShop_amountNow").data("ionRangeSlider");
        });
    </script>

    <script>
        $(document).ready(function () {
            var shopCommoditydb = {
                loadData: function (filter) {
                    return window.shopCommoditydb.clients;
                },
                insertItem: function (insertingClient) {
                    this.clents.push(insertingClient);
                },
                updateItem: function (updatingClient) { },
                deleteItem: function (deletingClient) {
                    var clientIndex = $.inArray(deletingClient, this.clents);
                    this.clents.splice(clientIndex, 1);
                }
            };
            window.shopCommoditydb = shopCommoditydb;
            shopCommoditydb.clents = [
            ];
        });
    </script>

    <script>
        $(function () {
            $("#shopCommodityJsGrid").jsGrid({
                height: "100%",
                width: "100%",
                filtering: false,
                editing: false,
                inserting: false,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 4,
                deleteConfirm: "Do you really want to delete the client?",
                controller: shopCommoditydb,
                noDataContent: "目前是空的......",
                fields: [
                    { name: "barCode", title: "商品条码", type: "text", width: 80 },
                    { name: "batchNo", title: "批次号", type: "text", width: 90 },
                    { name: "productName", title: "商品名称", type: "text", width: 100 },
                    { name: "timeRemain", title: "保质期剩余", type: "text", width: 60 },
                    { name: "amount", title: "数量", type: "number", width: 30 }
                ],
                rowClick: function (selectRow) {
                    var selectRowData = selectRow.item;
                    $.each(selectRowData, function (k, v) {
                        if ("amount" != k)
                            $("#wareToShop_" + k).val(v);
                        else {
                            window.wareToShop_amountNowBar.update({
                                min: 1,
                                max: v,
                                from: v
                            });
                        }
                    })
                }
            });
        });
    </script>

    <!-- 店内商品管理js -->
    <script>
        //封装查询指定商店货架商品请求
        function getShopCommodityJsGridData(shopShelfNo) {
            var requestObj = {};
            requestObj["requestService"] = "QueryCommodityByLocationService";
            requestObj["requestMethod"] = "queryCommodityByShopShelfNo";
            var data = {};
            data.shopShelfNo = shopShelfNo;
            requestObj["data"] = data;
            var requestJson = JSON.stringify(requestObj)

            var returnResult;
            $.ajax({
                type: "POST",
                url: "http://192.168.70.135:80/api/",
                async: false,
                contentType: "application/json",
                data: requestJson,
                success: function (msg) {
                    $.each(msg.data, function (k, v) {
                        var productTime = v.productTime;
                        var expire = v.expire;
                        if (expire == null || expire.length == 0) {
                            v.timeRemain = "不存在";
                            return;
                        }
                        var timeRemain = Number(productTime) + Number(expire) * 86400000 - (new Date()).valueOf();
                        var timeRemain = parseInt(timeRemain / 86400000);
                        v.timeRemain = timeRemain;
                    });
                    returnResult = msg.data;
                }
            });
            return returnResult;
        }
    </script>

    <script>
        //店内商品管理-原货架-选择商店后加载分区号
        $(document).ready(function () {
            $("#shopManageSource_shopSelect").change(function () {
                var selectWarehouseNo = $("#shopManageSource_shopSelect").val();
                resetShopSelect("shopManageSource");
                if (selectWarehouseNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopSection(selectWarehouseNo);
                setShopSectionData("shopManageSource", msg.data);
            })
        })
    </script>

    <script>
        //店内商品管理-原货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#shopManageSource_shopSectionSelect").change(function () {
                var selectSectionNo = $("#shopManageSource_shopSectionSelect").val();
                resetShopSectionSelect("shopManageSource");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopShelf(selectSectionNo);
                setShopShelfData("shopManageSource", msg.data);
            })
        })
    </script>

    <script>
        //店内商品管理-原货架-选择货架后加载商品列表
        $(document).ready(function () {
            $("#shopManageSource_shopShelfSelect").change(function () {
                var selectShelfNo = $("#shopManageSource_shopShelfSelect").val();
                if (selectShelfNo == "nullSelect") {
                    return;
                }
                window.shopManageCommoditydb.clients = getWarehouseCommodityJsGridData(selectShelfNo);
                $("#shopManageCommodityJsGrid").jsGrid("loadData");
            })
        })
    </script>

    <script>
        //店内商品管理-目标货架-选择商店后加载分区号
        $(document).ready(function () {
            $("#shopManageTarget_shopSelect").change(function () {
                var selectShopNo = $("#shopManageTarget_shopSelect").val();
                resetShopSelect("shopManageTarget");
                if (selectShopNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopSection(selectShopNo);
                setShopSectionData("shopManageTarget", msg.data);
            })
        })
    </script>

    <script>
        //店内商品管理-目标货架-选择分区后加载货架号
        $(document).ready(function () {
            $("#shopManageTarget_shopSectionSelect").change(function () {
                var selectSectionNo = $("#shopManageTarget_shopSectionSelect").val();
                resetShopSectionSelect("shopManageTarget");
                if (selectSectionNo == "nullSelect") {
                    return;
                }
                var msg = selectAllShopShelf(selectSectionNo);
                setShopShelfData("shopManageTarget", msg.data);
            })
        })
    </script>

    <script>
        $(document).ready(function () {
            $("#shopManage_amountNow").ionRangeSlider({
                min: 0,
                max: 0
            });
            window.shopManage_amountNowBar = $("#shopManage_amountNow").data("ionRangeSlider");
        });
    </script>

    <script>
        $(document).ready(function () {
            var shopManageCommoditydb = {
                loadData: function (filter) {
                    return window.shopManageCommoditydb.clients;
                },
                insertItem: function (insertingClient) {
                    this.clents.push(insertingClient);
                },
                updateItem: function (updatingClient) { },
                deleteItem: function (deletingClient) {
                    var clientIndex = $.inArray(deletingClient, this.clents);
                    this.clents.splice(clientIndex, 1);
                }
            };
            window.shopManageCommoditydb = shopManageCommoditydb;
            shopManageCommoditydb.clents = [
            ];
        });
    </script>

    <script>
        $(function () {
            $("#shopManageCommodityJsGrid").jsGrid({
                height: "100%",
                width: "100%",
                filtering: false,
                editing: false,
                inserting: false,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 4,
                deleteConfirm: "Do you really want to delete the client?",
                controller: shopManageCommoditydb,
                noDataContent: "目前是空的......",
                fields: [
                    { name: "barCode", title: "商品条码", type: "text", width: 80 },
                    { name: "batchNo", title: "批次号", type: "text", width: 90 },
                    { name: "productName", title: "商品名称", type: "text", width: 100 },
                    { name: "timeRemain", title: "保质期剩余", type: "text", width: 60 },
                    { name: "amount", title: "数量", type: "number", width: 30 }
                ],
                rowClick: function (selectRow) {
                    var selectRowData = selectRow.item;
                    $.each(selectRowData, function (k, v) {
                        if ("amount" != k)
                            $("#shopManage_" + k).val(v);
                        else {
                            window.wareManage_amountNowBar.update({
                                min: 1,
                                max: v,
                                from: v
                            });
                        }
                    })
                }
            });
        });
    </script>



    <script src="assets/js/lib/bootstrap.min.js"></script>
    <script src="assets/js/scripts.js"></script>
</body>

</html>